import 'package:flutter/cupertino.dart';
import 'package:flutter_basic_learning/utils/CommonWidget.dart';
import 'package:flutter_basic_learning/views/getx/getx_controller/DataShareController.dart';
import 'package:get/get.dart';

class GetxBindingPageTwo extends StatelessWidget {
  const GetxBindingPageTwo({super.key});

  @override
  Widget build(BuildContext context) {
    return commonScaffold('全局数据共享 - 页面2', [
      Obx(() =>
          commonText('全局数据共享： ${Get.find<DataShareController>().count.value}')),
      commonButton('count+1', () {
        Get.find<DataShareController>().count.value++;
      }),
      commonButton('返回PageOne', () {
        Get.back();
      })
    ]);
  }
}
